package nl.windgazer.arachne.services;

/**
 * <p>An interface describing several types of privileges available to the various components
 * of this library. Not every component needs access, but some do. And since these privileges
 * should be described in the actual web-application, the implementation that comes with
 * Arachne is only a 'dummy', with hopefully usefull example code of how to set up your own
 * implementation.</p>
 * 
 * <p>For most (or even all) of the 'safe' components this service won't be needed, for example
 * the cufon and fontface mixins won't need this service, while the translation services and
 * mixins definitely will!</p>
 * 
 * <p>As Arachne evolves more methods will likely be added to this interface, however it is
 * intended to stay 'light-weight' so that upgrading to a newer version 'should not' take up
 * a lot of time!</p>
 * 
 * @author mreuring
 *
 */
public interface ArachnePrivileges {

	/**
	 * For services that will need to 'store' or 'access' information pertaining to a single
	 * user (for reasons of privacy for instance) this method should provide a unique identifier.
	 * 
	 * This method will be used, for instance, for the auto-save mixin.
	 * 
	 * @return A unique identifier that will always be assigned to the same actual user.
	 */
	public String getPrivilegedID();

	/**
	 * Some services / components may require a security-role to determine the level of 
	 * functionality they should provide. This method should provide all of the roles that a
	 * user belongs to and the aforementioned services / components will call their own service-
	 * layers to determine what functionality to provide / block.
	 * 
	 * @return Security roles belonging to the actual user.
	 */
	public String[] getSecurityRoles();

	public boolean hasRole(String role);
}
